package com.tangyee.person_risk_assessment.data;

import java.util.ArrayList;
import java.util.List;

import top.defaults.view.PickerView;

public class UserWeight  implements PickerView.PickerItem  {

    private String weight;

    public UserWeight(String weight){
        this.weight = weight;
    }

    @Override
    public String getText() {
        return weight;
    }

    public float getWeight(){
        return Float.parseFloat(weight);
    }

    public static List<UserWeight> getUserWeightList(){
        List<UserWeight> userWeightList = new ArrayList<>();

        /**
         * 体重范围 35.0 -- 99.9
         */
        for(int i = 35; i < 100; i++ ){ // 整数部分
            for(int j = 0; j <= 9; j++ ){ // 小数部分
                String currentWeight = i + "." + j;
                userWeightList.add(new UserWeight(currentWeight));
            }
        }
        // 体重 100.0
        userWeightList.add(new UserWeight("100.0"));

        return userWeightList;
    }

    public static List<UserWeight> getUserWeightUnit(){
        List<UserWeight> unit = new ArrayList<>();
        unit.add(new UserWeight("kg"));
        return unit;
    }
}
